<template>
	<view>
		<view class="my-image" v-if="userInfo">
			<image :src="userInfo.avatarUrl" mode=""></image>
			<div>{{userInfo.nickName}}</div>
		</view>
		<button v-else type="primary" @click="godl">登录</button>
		<button type="warn" @click="retun">退出登录</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo:{},
				user_Token:""
			};
		},
		methods: {
			//登录
			godl() {
				uni.navigateTo({
					url:"/pages/dlsq/dlsq"
				})
			},
			// 退出登录
			// retun(){
			// 	uni.removeStorageSync("userInfo")
			// 	uni.removeStorageSync("user_Token")
			// }
		},
		onShow(){
			this.userInfo=uni.getStorageSync("userInfo"),
			this.user_token=uni.getStorageSync("user_Token")
		}
	}
</script>

<style lang="scss">
.my-image{
	width: 100%;
	height: 200rpx;
	text-align: center;
	>image{
	   width: 100rpx;
	   height: 100rpx;
	   border-radius: 50%;
	}
}
</style>
